var navTop = document.querySelectorAll('.nav-top');
var navZhe = document.querySelector(".nav-zhe");
var a = document.querySelector(".a");

a.onmouseenter = function() {
    navZhe.style.opacity = 1;
}
navZhe.onmouseleave = function() {
    navZhe.style.opacity = 0;
}
a.onmouseleave = function() {
    navZhe.style.opacity = 0;
}
console.log(navZhe);
var shouji = document.querySelector("#shouji");
console.log(shouji);
var tu = document.querySelector('.tu');
shouji.onmouseenter = function() {
    tu.style.opacity = 1;
}
tu.onmouseleave = function() {
    tu.style.opacity = 0;

}
var ju2P = document.querySelectorAll(".ju-2-left-nav-right p");
var ju2Kuai = document.querySelectorAll(".ju-2-kuai");
var ju2Zhe = document.querySelectorAll(".ju-2-kuai-zhe");

var ju2ZheImg = document.querySelectorAll(".ju-2-kuai img");
console.log(ju2ZheImg);
for (var i = 0; i < ju2Kuai.length; i++) {
    ju2Kuai[i].index = i;

    ju2Kuai[i].onmouseenter = function() {
        // console.log(this.index);
        this.style.transform = "translateY(-10px)";
        ju2Zhe[this.index].style.display = "block";
    }
    ju2Kuai[i].onmouseleave = function() {
        this.style.transform = "translateY(0px)";
        ju2Zhe[this.index].style.display = "none";
    }
}
for (var i = 0; i < ju2P.length; i++) {
    ju2P[i].index = i;
    var ju2Index;
    ju2P[i].onmouseenter = function() {
        this.style.borderBottom = " 2px solid rgb(112, 167, 218)";
        if (this.index == 0) {
            for (var j = 0; j < ju2ZheImg.length; j++) {
                ju2ZheImg[j].src = "./img/新建文件夹/正在进行" + (j + 1) + ".jpg"
            }
        }
        if (this.index == 1) {
            for (var j = 0; j < ju2ZheImg.length; j++) {
                ju2ZheImg[j].src = "./img/新建文件夹/商城特惠" + (j + 1) + ".jpg"
            }
        }
        if (this.index == 2) {
            for (var j = 0; j < ju2ZheImg.length; j++) {
                ju2ZheImg[j].src = "./img/新建文件夹/长期活动" + (j + 1) + ".jpg"
            }
        }
    }
    ju2P[i].onmouseleave = function() {
        this.style.borderBottom = "none";


    }
}
// j3===========================
var xia = document.querySelector(".xia");
var ju3z = document.querySelector(".ju-3-zhe2")
var ju3LR = document.querySelector(".ju-3-left-right")
ju3LR.onmouseenter = function() {
    xia.style.height = "117px";
    ju3z.style.visibility = "visible";
}
ju3LR.onmouseleave = function() {
    xia.style.height = "0px";
    ju3z.style.visibility = "hidden";

}
xia.onmouseenter = function() {
    xia.style.height = "117px";
    ju3z.style.visibility = "visible";
}
xia.onmouseleave = function() {
    xia.style.height = "0px";
    ju3z.style.visibility = "hidden";

}